package core;

import java.util.Iterator;

import dal.IPet;
import dal.Pet;


public class PetsSerializableIteratorWrapper implements Iterator<IPet>{

	private Iterator<IPet> iter;
	private ServerSession session;
	
	public PetsSerializableIteratorWrapper(Iterator<IPet> actualIter,ServerSession session){
		iter = actualIter;
		this.session = session;	
	}
	
	@Override
	public boolean hasNext() {
		return iter.hasNext();
	}

	@Override
	public IPet next() {
		Pet nextPet = (Pet)iter.next();
		nextPet.setSession(session);
		return nextPet;
	}

	@Override
	public void remove() {
		iter.remove();
	}

	
}
